home *** CD-ROM | disk | FTP | other *** search
/ CICA 1993 April / CICA MS Windows - April 1993.iso / unzipped / util / w3setcom / stdmac.inc < prev   
Text File  |  1990-06-29  |  3KB  |  105 lines

  1. ;----------------------------------------------------------
  2. ; MACRO DEFINITIONS INCLUDE FILES  (STDMAC.INC)
  3. ;----------------------------------------------------------
  4. ; STANDARD EQUATES:
  5. ;
  6. TRUE    EQU     0FFFFh
  7. FALSE   EQU     0
  8. ;
  9. ;Standard nonprintable ASCII characters
  10. NUL     EQU     0
  11. BEL     EQU     7
  12. BS      EQU     8
  13. HT      EQU     9
  14. LF      EQU     10
  15. FF      EQU     12
  16. CR      EQU     13
  17. SUBST   EQU     1Ah
  18. ESCAPE  EQU     1Bh
  19. SPACE   EQU     20h
  20. COLON   EQU     3Ah
  21. SCOLON  EQU     3Bh
  22. ;
  23. ; IBM Extended characters
  24. SLINE   EQU     11000100b
  25. ;
  26. ;---------------------------------------------------------
  27. ;;** @DisChr ******************************* GENERAL PURPOSE MACRO ******
  28. ;; display an immediate character
  29. IF1     ;; assemble only during Pass 1
  30. @DisChr MACRO   char
  31.     IFNB <char>     ;; was character argument specified?
  32.             ;; yes, so insert code
  33.     push    ax      ;; save registers used
  34.     push    dx
  35.     mov     dl,char ;; load the character
  36.     mov     ah,02h  ;; load func. number
  37.     @DosCall        ;; call ms-dos
  38.     pop     dx
  39.     pop     ax
  40.     ELSE            ;; otherwise
  41.     .ERR            ;; generate error and output message
  42.     %OUT @DisChr macro: "char" argument not supplied.
  43.     ENDIF
  44.     ;;
  45.     ENDM    ;; end of macro definition
  46. ENDIF   ;; end of pass execution
  47. ;;
  48. ;;** DOS call *************************************************
  49. ;; Call an MS-DOS function
  50. IF1     ;; assemble only during Pass 1
  51. @DosCall MACRO
  52.     int     21h
  53.     ENDM    ;; end of macro definition
  54. ENDIF   ;; end of pass execution
  55. ;;
  56. ;;** @ExitToDos ********************* GENERAL PURPOSE MACRO *********
  57. ;; Terminate process with optional ERRORLEVEL settings
  58. IF1
  59. @ExitToDos MACRO errorcode
  60.     IFB <errorcode> ;; was errorcode spec'd?
  61.     mov    ax,4C00h        ;; no load func & errorlevel 0
  62.     ELSE
  63.     mov     ah,4Ch
  64.     mov     al,errorcode
  65.     ENDIF
  66.     @DosCall
  67.     ENDM
  68. ENDIF
  69. ;;
  70. ;; ** @DisStr *********************** GENERAL PURPOSE MACRO **********
  71. ;; Display a strng from memory with default "$"
  72. ;; end of string terminator or with a spceified terminator
  73. ;; Calls @DisStr1 or @DisStr2 internal macros.)
  74. IF1     ;; assemble only in pass 1
  75. @DisStr MACRO   string,terminator
  76.     IFNB <string>   ;; was string specifid
  77.             ;; yes, so...
  78.       IFB <terminator> ;; was terminator spec'd?
  79.         ;; no, so insert the default code for "$"
  80.         @DisStr1 string
  81.       ELSE ;; otherwise terminator spec'd
  82.         ;;    @DisStr2 string,terminator
  83.       ENDIF ;; end term check
  84.     ELSE ;;otherwise string not spec'd
  85.     .ERR    ;; gen error and message
  86.     %OUT @DisStr macro: "string" agrument not supplied.
  87.     ENDIF
  88.     ENDM
  89. ENDIF ;; end pass execution
  90. ;;
  91. ;;** @DisStr1 **********************************Support Macro **
  92. ;; Called by @DisStr to display string form memory with
  93. ;; default "$" end-of-string terminator.
  94. IF1
  95. @DisStr1 MACRO  string
  96.     push    ax
  97.     push    dx
  98.     mov     dx,offset ds:string ;; point to string in mem
  99.     mov     ah,09h
  100.     @DosCall
  101.     pop     dx
  102.     pop     ax
  103.     ENDM
  104. ENDIF
  105.